// 用来对{channel: string, refresh_channel: string }做本地持久化

import { channelType } from '@/types/data'

const channel_KEY = 'geek-h5-channel'

// 获取 channel
export function getchannels(): channelType[] {
  return JSON.parse(localStorage.getItem(channel_KEY) || '[]') 
}

// 设置 channel
export function setchannels(channels: channelType[]): void {
  localStorage.setItem(channel_KEY, JSON.stringify(channels))
}

// 移除 channel
export function removechannels(): void {
  localStorage.removeItem(channel_KEY)
}

